package com.mspbots.core.ticketai.service;

import com.fasterxml.jackson.databind.JsonNode;
import com.mspbots.core.DefaultBaseService;
import com.mspbots.core.ticketai.model.TicketRule;

import java.util.List;
import java.util.Map;

/**
 * com.mspbots.core.ticketai.service.TicketRuleService
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/8/20
 */
public interface TicketRuleService extends DefaultBaseService<TicketRule> {

    /**
     * save ticket rule update or install
     *
     * @param ticketRules save entry
     * @return
     */
    List<TicketRule> saveBatchAll(List<TicketRule> ticketRules);

    /**
     * get ticket rule or  get system ticket rule
     *
     * @param tenantId query tenant params
     * @param board    query boards params
     * @return ticket rule or system rule
     */
    List<TicketRule> getBoardRules(Long tenantId, Integer board);

    /**
     * get ticket rule  count
     *
     * @param tenantId query tenant params
     * @return ticket rule or system rule
     */
    JsonNode getRulesCount(long tenantId);


    /**
     * get ticket rule or  get system ticket rule
     *
     * @param tenantId query tenant params
     * @param board    query boards params
     * @param name     query name params
     * @return ticket rule or system rule
     */
    List<TicketRule> getRules(long tenantId, String board, String name);

    List<TicketRule> getAllBoardRulesByName(TicketRule ticketRule);

    Map<String, Object> repairStatus(Long tenantId);

    Boolean initStatus(Long tenantId);
}
